//导入 二次封装的axios
import axios from './request'

//一个接口  封装成一个函数
function user_login( params = {} ){
    return axios.post('/api/user/login', params )
}

function user_register( params = {} ){
    return axios.post('/api/user/register', params )
}

function shop_list( params = {} ){
    return axios.get('/api/shop/list', { params } )
}

function shop_info( params = {} ){
    return axios.get('/api/shop/shopinfo', { params } )
}
function shopcart_add( params = {} ){
    return axios.post('/api/shopcart/add', params )
}
function shopcart_sub( params = {} ){
    return axios.post('/api/shopcart/sub', params )
}
function shopcart_list( params = {} ){
    return axios.get('/api/shopcart/list', { params } )
}
function shopcart_clear( params = {} ){
    return axios.post('/api/shopcart/clear', params )
}
function shop_fav( params = {} ){
    return axios.post('/api/shop/fav', params )
}
function shop_unfav( params = {} ){
    return axios.post('/api/shop/unfav', params )
}
function shop_table( params = {} ){
    return axios.get('/api/shopcart/list', params)
}
function banner_list( params = {} ){
    return axios.get('/api/banner/list', params)
}
function shop_search( params = {} ){
    return axios.get('/api/shop/search', params)
}

//导出需要在外部 调用的函数
export {
    user_login,
    user_register,
    shop_list,
    shop_info,
    shopcart_add,
    shopcart_list,
    shopcart_sub,
    shopcart_clear,
    shop_fav,
    shop_unfav,
    shop_table,
    banner_list,
    shop_search
}